home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / visual / perl.exe / {app} / Webroot / cgi-bin / quadraphobia.pl < prev    next >
Encoding:
Perl Script  |  2003-01-11  |  729 b   |  24 lines

  1. #!perl
  2.  
  3. use CGI qw/:standard/;
  4.  
  5. print header,
  6.     start_html('QuadraPhobia'),
  7.     h1('QuadraPhobia'),
  8.     start_form(),
  9.     image_button(-name=>'square',
  10.                  -src=>'red_square.gif',
  11.                  -width=>200,
  12.                  -height=>200,
  13.                  -align=>MIDDLE),
  14.     end_form();
  15. if (param()) {
  16.     ($x,$y) = (param('square.x'),param('square.y'));
  17.     $pos = 'top-left' if $x < 100 && $y < 100;
  18.     $pos = 'top-right' if $x >= 100 && $y < 100;
  19.     $pos = 'bottom-left' if $x < 100 && $y >= 100;
  20.     $pos = 'bottom-right' if $x >= 100 && $y >= 100;
  21.     print b("You clicked on the $pos part of the square.");
  22. }
  23. print p,a({href=>'../source.html'},"Code examples");
  24. print end_html();